﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


//玩家实例
public class Player
{

    public bool IsOnLine
    {
        get
        {
            return m_isOnline;
        }
    }

    public string SessionId
    {
        get
        {
            return m_sessionId;
        }
        set
        {
            m_sessionId = value;
        }
    }

    public Player(string sessionId, string info)
    {
        m_sessionId = sessionId;
        m_info = info;
    }

    /// <summary>
    /// 客户端离线提示
    /// </summary>
    /// <param name="clientId"></param>
    public void ClientOffline(string clientId)
    {
        m_isOnline = false;
    }

    /// <summary>
    /// 客户端上线提示
    /// </summary>
    /// <param name="clientId"></param>
    public void ClientOnline()
    {
        m_loginTime = DateTime.Now.Ticks;
        m_activityTime = DateTime.Now.Ticks;
    }

    //是否在线
    private bool m_isOnline = false;
    //上一次活跃时间
    private long m_activityTime = 0;
    //login时间
    private long m_loginTime = 0;
    //客户端ID
    private string m_sessionId = string.Empty;
    //客户端信息
    private string m_info = string.Empty;
    //数据库 待设计框架
    private PlayerDB m_model = new PlayerDB();

}
